{include file="../Common/header.html"}
	<link rel="stylesheet" href="./Public/Home/Css/question.css" />
	<script type="text/javascript" src="./Public/Home/Js/question.js"></script>

{include file="../Common/nav.html"}

	
	<div id='location'>
		<a href="./index.php?c=list&cid=0&asid=0">全部分类</a>
		{section loop=$parentsCate name=k}
			{if $smarty.section.k.last}
			&gt;&nbsp;{$parentsCate[k].title}&nbsp;&nbsp;
			{else}
			&gt;&nbsp;<a href="./index.php?c=list&cid={$parentsCate[k].cid}">{$parentsCate[k].title}</a>&nbsp;&nbsp;
			{/if}
		{/section}	
	</div>
		

<!--------------------中部-------------------->
	<div id='center-wrap'>
		<div id='center'>
			<div id='left'>
				<div id='answer-info'>
					<!-- 如果没有解决用wait -->
					<div class='ans-state {if $askTitle.0.solve==0 } wait {/if}'></div>
					<div class='answer'>
						<p class='ans-title'>{$askTitle.0.content}
							<b class='point'>{$askTitle.0.reward}</b>
						</p>
					</div>
			<!-- 问题用户信息 -->
					<ul>
						<li><a href="">{$askTitle.0.username}</a></li>
						<li><i class='level lv1' title='Level 1'></i></li>
						<li>{$askTitle.0.time|date_format:"%Y-%m-%d %H:%M:%S"}</li>
				
					</ul>
					<!--1.必须登陆-->
					<!--2.问题不能是自己的问题-->
					<!--3.问题必须没有被解决-->

			{if $smarty.session.username and $smarty.session.uid and $smarty.session.uid != $askTitle.0.uid and $askTitle.0.slove ==0 }
					<div class='ianswer'>
						<form name='answer' action="" method='POST'>
							<p>我来回答</p>
							<textarea name="content"></textarea>
							<input type="hidden" name='qid' value='{$smarty.get.asid}'>
							<input type="submit" value='提交回答' id='anw-sub'/>
						</form>
					</div>
			{/if}
			
			{if $accept}
					<!-- 满意回答 -->
					<div class='ans-right'>
						<p class='title'><i></i>满意回答<span></span></p>
						<p class='ans-cons'>{$accept.0.content}</p>
						<dl>
							<dt>
								<a href=""><img src="./Public/Home/Images/noface.gif" width='48' height='48'/></a>
							</dt>
							<dd>
								<a href="">{$accept.0.username}</a>
							</dd>
							<dd><i class='level lv1'></i></dd>
							<dd>20%</dd>
						</dl>
					</div>
					<!-- 满意回答 -->
			{/if}
				</div>

				<div id='all-answer'>
					<div class='ans-icon'></div>
					<p class='title'>共 <strong>{$totalAnswer}</strong> 条回答</p>
					<ul>
					{foreach from=$answerData item=v}
						<!-- 显示未采纳的列表 -->
						{if $v.saccept==0 }	
						<li>
							<div class='face'>
								<a href="">
									<img src="./Public/Home/Images/noface.gif" width='48' height='48'/>
								</a>
							</div>
							<div class='cons blue'>
								<p>{$v.scontent}<span style='color:#888;font-size:12px'>&nbsp;&nbsp;({$v.stime|date_format:"%Y-%m-%d %H:%M:%S"})</span></p>
							</div>
							{if $smarty.session.username and $smarty.session.uid and $smarty.session.username == $v.username}
								<a href="./index.php?c=show&a=accept&anid={$v.anid}" class='adopt-btn'>采纳</a>
							{/if}
						</li>
						{/if}
					{/foreach}

					</ul>
					<div class='page'>
						<a href="">1</a>
						<a href="">2</a>
						<a href="">3</a>
						<a href="">4</a>
					</div>
				</div>
				{if $relateAsk}
				<div id='other-ask'>
					<p class='title'>待解决的相关问题</p>
					<table>
						{foreach from=$relateAsk item=v}
						<tr>
							<td class='t1'><a href="./index.php?c=show&asid={$v.asid}">{$v.content}</a></td>
							<td>20&nbsp;回答</td>
							<td>{$v.time|date_format:"%Y-%m-%d %H:%M"}</td>
						</tr>
						{/foreach}
					</table>
				</div>
				{/if}
			</div>
		<!-- 右侧 -->
{include file='../Common/right.html'}
<!-- ---右侧结束---- -->
			
		</div>

	</div>
	
<!--------------------中部结束-------------------->
	{literal}
	<script type="text/javascript">
		$(function(){
			$("form[name='answer']").submit(function(event) {
				var content = $.trim($("textarea[name='content']").val());
				if(!content){
					$.cxDialog('内容不能为空');
					return false;
				}
			});
		})
	</script>
	{/literal}
{include file="../Common/footer.html"}